//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<CStaticModelBatch.h>
///	@path	~/src/graphics/batch/
///	@date	2007/11/15
///	@desc	Static batch with a list of models.

#pragma once

#include "xeres.h"

#include <set>

#include "graphics/IBatch.h"
#include "graphics/IModel.h"

namespace xeres {

	/*!
		\class	CStaticModelBatch
		\brief	Batch which only records models inside, draws them without selecting or dividing.
	*/
	class CStaticModelBatch : public IBatch
	{
	public:

		/// \name Constructor & Destructor
		//@{

		/// \ctor
		CStaticModelBatch( void );

		/// \dtor
		virtual ~CStaticModelBatch( void );

		//@}

		DECL_IOBJECT_CLASS_DYNAMIC( CStaticModelBatch , IBatch );

	public:

		/// \impl	IBatch::BeginBatch
		virtual void BeginBatch( void );

		/// \impl	IBatch::EndBatch
		virtual void EndBatch( void );

		/// \impl IBatch::Render
		virtual void Render( RenderContext& rc );

		/// \brief	Add model.
		void AddModel( RefWeak<IModel> model );

	private:

	//@ data

		// batch state

		// batch list
		typedef std::set< RefWeak<IModel> >		_BatchList;
		_BatchList								m_batchList;
	};

} // namespace xeres
